<?php

class UpyunAction extends AdminbaseAction{

	public $bucketname;
	public $username;
	public $password;
	public $upyun;

	public function __construct(){

		require_once 'Class/upyun.class.php';

		$this->bucketname = '';
		$this->username = '';
		$this->password = '';

		$this->$upyun = new UpYun($this->bucketname,$this->username,$this->password);

	}

	public function index(){
		echo 1;
	}
	
	public function writeFile(){
		$file = 'data/images/noimg.png';
		$fp = fopen($file, 'r');
		$res = $this->upyun->writeFile('/',$fp,1);

		print_r($res);
	}
}